<template>
  <div id="chartContainer" style="width: 100%; height: 1000px"></div>

</template>
<script setup>
//挂载时候，构建bi展现器实例
import {onMounted} from 'vue';

import axios from "axios";
let isPrintInfo=true;
function onUpdateData(datasets, params) {
  return new Promise((resolve, reject) => {
    if(isPrintInfo){
      console.log("chart_1,onUpdateData:[]")
    }
    resolve([]);

  })
}
//导入BI报表对应的完整的数据集
let reportInstance = null;
onMounted(() => {
  axios({
    url: '/api/xzchart/report1/configanddata',
    method: 'post',
    data: {
      reportType: 'chart',
      reportId: 'Chart1'
    }
  }).then((response) => {
    let data = response.data.data.data;
    let config = response.data.data.config;
    console.log("Chart_1.vue  axios.post  config:", config);
    console.log("Chart_1.vue  axios.post  data:", data);
    reportInstance = new XZDashboard("#chartContainer", {reportConfig: config, reportData: [], paramsConfig: []});
    reportInstance.updateData(data);
  }).catch((error) => {
    console.log(error);
  })


});
</script>

<style scoped>

</style>
